package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.view;

import android.content.Intent;
import android.graphics.Paint;
import android.view.View;
import android.widget.EditText;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.R;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.base.BaseActivity;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.IChangeLoginPasswordContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.persenter.ChangeLoginPasswordPersenter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.MyToastUtils;

/**
 * Created by Administrator on 2018/8/15.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class ChangeLoginPasswordActivity extends BaseActivity implements IChangeLoginPasswordContract.IChangeLoginPasswordView {
    private ChangeLoginPasswordPersenter mChangeLoginPasswordPersenter = new ChangeLoginPasswordPersenter(this);
    private EditText et_input_current_password;
    private EditText et__input_new_password;
    private EditText et_confirm_password;


    @Override
    protected void userAgreedPermissions() {

    }

    @Override
    protected View AddLayoutView() {
        View view  =View.inflate(this, R.layout.activity_change_login_password,null);
        et_input_current_password = view.findViewById(R.id.activity_change_login_password_et_input_current_password);
        et__input_new_password = view.findViewById(R.id.activity_change_login_password_et__input_new_password);
        et_confirm_password = view.findViewById(R.id.activity_change_login_password_et_confirm_password);

        return view;
    }

    @Override
    protected void initChildViewDate() {
        mChangeLoginPasswordPersenter.initTitle();
    }

    @Override
    protected void onClickedTvRight() {
        mChangeLoginPasswordPersenter.onClickedDetermine(this);
    }

    @Override
    protected void onClickedIvRight() {

    }

    @Override
    protected void onClickedIvLeft() {
        finish();
    }

    @Override
    public void showTitle() {
        showTilteBg();
        showTitleContent();
        showTileIvLeft();
        showTilteRightTVContent();
        //设备管理(6)
        setTitleContent("修改密码", 0xffffffff);
        setTilteRightTVContent("确认",0xffffffff);
        setIvLeftIcon(R.mipmap.left_white_return);
        setTitleContentSize(16);
    }

    @Override
    public String getCurrentPassword() {
        return et_input_current_password.getText().toString().trim();
    }

    @Override
    public void setCurrentPassword(String password) {
        et_input_current_password.setText(password);
    }

    @Override
    public String getNewPassword() {
        return et__input_new_password.getText().toString().trim();
    }

    @Override
    public void setNewPassword(String password) {
        et__input_new_password.setText(password);
    }

    @Override
    public String getConfirmPassword() {
        return et_confirm_password.getText().toString().trim();
    }

    @Override
    public void setConfirmPassword(String password) {
        et_confirm_password.setText(password);
    }

    @Override
    public void showToastInfo(String message) {
        MyToastUtils.ShortToaseShow(this,message);
    }

    @Override
    public void finshPager() {
        Intent intent = new Intent(this,LoginActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(intent);
    }
}
